<script lang="ts" setup>
import ProTable from '@/components/tables/pro-table/idnex'

const columns = ref([
  {
    title: '标题',
    key: 'title',
    width: 100,
    fixed: 'left',
  },
  {
    title: '名称',
    key: 'name',
    minWidth: 100,
    valueType: 'input',
  },
  {
    title: '路径',
    key: 'path',
    width: 300,
    valueType: 'input',
  },
  {
    title: '组件',
    key: 'component',
    width: 200,
    valueType: 'input',
  },
  {
    title: '图标',
    key: 'icon',
    width: 200,
  },
  {
    title: '重定向',
    key: 'redirect',
    width: 200,
    valueType: 'input',
  },
  {
    title: '保活状态',
    key: 'keepAlive',
    width: 100,
  },
  {
    title: '启用状态',
    key: 'status',
    width: 100,
    valueType: 'select',
    valueEnum: {
      1: { value: 1, label: '启用' },
      2: { value: 2, label: '禁用' },
    },
  },
  {
    title: '操作',
    key: 'action',
    width: 150,
    fixed: 'right',
    align: 'center',
    render() {
      return '1'
    },
  },
] as any)
const data = ref([
  {
    id: 1,
    pid: null,
    path: '/dashboard',
    name: 'Dashboard',
    component: 'RouteView',
    redirect: '/dashboard/analysis',
    title: '仪表盘',
    icon: 'DashboardOutlined',
  },
  {
    id: 2,
    pid: 1,
    path: '/dashboard/analysis',
    name: 'DashboardAnalysis',
    component: 'DashboardAnalysis',
    title: '分析页',
    keepAlive: false,
  },
  {
    id: 3,
    pid: 1,
    name: 'DashboardWorkspace',
    path: '/dashboard/workspace',
    component: 'DashboardWorkspace',
    title: '访问量',
    keepAlive: false,
  },
  {
    id: 5,
    pid: null,
    name: 'Menu1',
    path: '/menu',
    component: 'RouteView',
    redirect: '/menu/1-1',
    title: '菜单',
    icon: 'MenuOutlined',
  },
  {
    id: 6,
    pid: 5,
    name: 'Menu1-1',
    path: '/menu/1-1',
    redirect: '/menu/1-1/1-1-1',
    component: 'RouteView',
    title: '菜单1',
  },
  {
    id: 7,
    pid: 5,
    name: 'Menu1-2',
    path: '/menu/1-2',
    component: 'RouteView',
    redirect: '/menu/1-2/1-2-1',
    title: '菜单2',
  },
  {
    id: 10,
    pid: 7,
    name: 'Menu1-2-1',
    path: '/menu/1-2/1-2-1',
    component: 'Menu21',
    title: '菜单3',
    keepAlive: true,
  },
  {
    id: 11,
    pid: 7,
    name: 'Menu1-2-2',
    path: '/menu/1-2/1-2-2',
    component: 'Menu22',
    title: '菜单4',
    keepAlive: true,
  },
  {
    id: 8,
    pid: 6,
    name: 'Menu1-1-1',
    path: '/menu/1-1/1-1-1',
    component: 'Menu11',
    title: '菜单5',
    keepAlive: false,
  },
  {
    id: 9,
    pid: 6,
    name: 'Menu1-1-2',
    path: '/menu/1-1/1-1-2',
    component: 'Menu12',
    title: '菜单6',
    keepAlive: false,
  },
  {
    id: 4,
    pid: null,
    name: 'JumpBaidu',
    path: 'https://www.baidu.com',
    component: 'BlankRoute',
    title: '跳转百度',
    icon: 'LinkOutlined',
  },
])
</script>

<template>
  <div class="my-6">
    <ProTable :columns="columns" :data="data" :scroll-x="1800" />
  </div>
  <!--  <n-card class="my-5">
      <NDataTable :columns="columns" :data="data" :page-size="pageSize" />
    </n-card> -->
</template>
